'''
Created on Sep 23, 2011

@author: root
'''
import wx
class ContextMenu(wx.Menu):
    def __init__(self, frame):
        super(ContextMenu, self).__init__()

        self.frame = frame

        mmi = wx.MenuItem(self, wx.NewId(), 'Minimize')
        self.AppendItem(mmi)
        self.Bind(wx.EVT_MENU, self.OnMinimize, mmi)

        cmi = wx.MenuItem(self, wx.NewId(), 'Close')
        self.AppendItem(cmi)
        self.Bind(wx.EVT_MENU, self.OnClose, cmi)
        
        self.frame.Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown)

    def OnRightDown(self, e):
        self.frame.PopupMenu(self, e.GetPosition())

    def OnMinimize(self, e):
        self.frame.Iconize()

    def OnClose(self, e):
        self.frame.Close()
        
        
pass